using UnityEngine;

public class ShootMobLogic : BaseMobLogic
{
	private float chaseToDistance;

	private Transform target;

	public override void OnStart(LogicController contriller, string enterFromLogic, params object[] args)
	{
		base.OnStart(contriller, enterFromLogic);
		LogicEvent(3);
		chaseToDistance = (float)args[1];
		target = (Transform)args[0];
		StartTimer(1f, false);
	}

	public override void OnTimerTick()
	{
		LogicEvent(3);
	}

	public override void OnEvent(int name, params object[] args)
	{
		switch ((mobAssignerEvent)name)
		{
		case mobAssignerEvent.TargetOutShootRande:
			ChangeLogic("Chase", target, chaseToDistance);
			break;
		case mobAssignerEvent.Chase:
			ChangeLogic("Chase", target, chaseToDistance);
			break;
		case mobAssignerEvent.TargetClear:
			ChangeLogic("Walk");
			break;
		default:
			base.OnEvent(name, args);
			break;
		}
	}
}
